package com.os.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.os.service.RequestServiceM;
import com.os.serviceimpl.RequestServiceImplM;

import net.sf.json.JSONArray;

/**
 * 根据日期查询审批信息
 * @author MWX
 *
 */
public class SearchChecksByDateControllerM extends HttpServlet{
	RequestServiceM rsm=new RequestServiceImplM();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	// TODO Auto-generated method stub
	doPost(req, resp);
}
@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
	  req.setCharacterEncoding("utf8");
	  resp.setCharacterEncoding("utf8");
	  PrintWriter pw=resp.getWriter();
      String year=req.getParameter("dyear");
      String month=req.getParameter("dmonth");
      String day=req.getParameter("dday");
      JSONArray j=new JSONArray();
      JSONArray ja=rsm.searchChecksByDate(year, month, day);
      j.add(ja);
      pw.write(j.toString());
      pw.flush();
      pw.close();
}
}
